﻿<%@ CODEPAGE=65001 %>
<%
'///////////////////////////////////////////////////////////////////////////////
'// 插件应用:    Z-Blog 2.0 其它版本未知
'// 插件制作:    狼的旋律(http://www.wilf.cn) / zsx(http://www.zsxsoft.com)
'// 备    注:    编辑图片信息
'// 最后修改:
'// 最后版本:
'///////////////////////////////////////////////////////////////////////////////
%>
<% Option Explicit %>
<% 'On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="../../c_option.asp" -->
<!-- #include file="../../../zb_system/function/c_function.asp" -->
<!-- #include file="../../../zb_system/function/c_system_lib.asp" -->
<!-- #include file="../../../zb_system/function/c_system_base.asp" -->
<!-- #include file="../../../zb_system/function/c_system_plugin.asp" -->
<!-- #include file="../p_config.asp" -->
<%
Call System_Initialize()
Call WindsPhoto_Initialize()

Call CheckReference("")

If BlogUser.Level>2 Then Call ShowError(6)
If CheckpluginState("windsphoto") = False Then Call ShowError(48)

BlogTitle = "WindsPhoto 编辑图片"
%>
<!--#include file="..\..\..\zb_system\admin\admin_header.asp"-->
<script type="text/javascript" src="../../../zb_system/script/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="../../../zb_system/ADMIN/ueditor/ueditor.config.asp"></script>
<script type="text/javascript" src="../../../zb_system/ADMIN/ueditor/ueditor.all.min.js"></script>
<!--#include file="..\..\..\zb_system\admin\admin_top.asp"-->
<div id="divMain"><div id="ShowBlogHint"><%Call GetBlogHint()%></div>
	<div class="divHeader"><%=BlogTitle%></div>
    <div class="SubMenu"><%=WindsPhoto_SubMenu(0)%></div>
    <div id="divMain2">
		<script type="text/javascript">ActiveLeftMenu("aWindsPhoto")</script>
<%
Dim rs,id,sql,name,url,surl,hot,zhuanti,jj,time,temprs
If Request.QueryString("action") = "edit" Then
	id = Request.QueryString("id")
	sql = "SELECT * FROM WindsPhoto_desktop where id="&id
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open sql, objConn, 1, 1
	name = rs("name")
	url = rs("url")
	surl = rs("surl")
	hot = rs("hot")
	zhuanti = rs("zhuanti")
	jj = rs("jj")
	time = rs("itime")
	If time Then
		time = Replace(time,"/","-")
	Else
		time = ""
	End If
	rs.Close
	Set rs = Nothing
End If
%>
		<form id="edit" name="edit" method="post" action="admin_cmd.asp?action=editphoto&id=<%=id%>">
			<div id="divEditLeft">
				<p>标题: <input type="text" name="name" maxlength="30" value="<%=name%>" size="50" /></p>
				<p>地址: <input type="text" name="url" value="<%=url%>" size="50" /></p>
				<p>缩图: <input type="text" name="surl" value="<%=surl%>" size="50" /></p>
				<p>图片简介:<br />
				<div><textarea name="jj" id="editor_ue" style="width:500px;"><%=TransferHTML(jj,"[textarea]")%></textarea></div>
				</p>
				<p>
				<input type=submit value="确定" name="submit" class="button" />
				<input type=reset value="重置" name="reset" class="button" />
				</p>
			</div>
			<div id="divEditRight">
				<p>相册:<select name="zhuanti">
<%
Set temprs = objConn.Execute("SELECT * FROM WindsPhoto_zhuanti order by ordered,id asc")
Do While Not temprs.EOF
	Response.Write"<option value='"&temprs("id")&"'"
	If zhuanti = temprs("id") Then Response.Write" selected"
	Response.Write">"&temprs("name")&"</option>"
	temprs.movenext
Loop
%>
				</select>
				</p>
				<p>时间:<input type="text" name="itime" value="<%=time%>" id="datetime" size="20" /></p>
				<p>封面:<input type="checkbox" name="hot" value="1" <%=IIF(hot=1,"checked","")%> /></p>
				<p><img src="<%=url%>" title="图片预览" style="max-width:220px;" /></p>
			</div>
		</form>
    </div>
</div>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
	$("#edit").submit(function(){
		if(editor.queryCommandState("source")==1) editor.execCommand("source");
	}) //源码模式下保存时必须切换
});

var EditorOption = {
	toolbars:[['Source','fontsize','bold','italic','forecolor','emotion','blockquote','link','removeformat','formatmatch','autotypeset','insertorderedlist','insertunorderedlist','pasteplain']],
	autoHeightEnabled:false,
	initialFrameHeight:150
};
var editor=UE.getEditor('editor_ue',EditorOption);

//日期时间控件
$.datepicker.regional['zh-cn'] = {
	closeText: '完成',
	prevText: '上个月',
	nextText: '下个月',
	currentText: '现在',
	monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
	monthNamesShort: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
	dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
	dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
	dayNamesMin: ['日','一','二','三','四','五','六'],
	weekHeader: '周',
	dateFormat: 'yy-m-d',
	firstDay: 1,
	isRTL: false,
	showMonthAfterYear: true,
	yearSuffix: ' 年  '
};
$.datepicker.setDefaults($.datepicker.regional['zh-cn']);
$.timepicker.regional['zh-cn'] = {
	timeOnlyTitle: '时间',
	timeText: '时间',
	hourText: '小时',
	minuteText: '分钟',
	secondText: '秒钟',
	millisecText: '毫秒',
	currentText: '现在',
	closeText: '完成',
	timeFormat: 'h:m:s',
	ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['zh-cn']);
$('#datetime').datetimepicker({
	showSecond: true
	//changeMonth: true,
	//changeYear: true
});
// ]]>
</script>
<!--#include file="..\..\..\zb_system\admin\admin_footer.asp"-->
<%Call System_Terminate()%>